import {getGoods} from "api/api"
export default {
    state:{
        searchData:{} //  search组件的商品及其相关信息
    },
    getters:{},
    mutations:{
        getGoods(state,searchData){
            state.searchData = searchData
        }
    },
    actions:{
        //获取三级分类数据的action
        async getGoods(store,options={}){
            const {code,data} = await getGoods(options);
            if(code === 200){
                //提交mutation
                store.commit("getGoods",data);
                return data;
            }
        },
    }
}